"use strict";

module.exports = {
  // 在执行数据库升级时调用的函数，创建 t_role_funcs 表
  up: async (queryInterface, Sequelize) => {
    const { INTEGER, DATE, UUIDV4, CHAR, UUID } = Sequelize;
    await queryInterface.createTable("t_org_user", {
      id: {
        type: UUID,
        primaryKey: true,
        allowNull: false,
        defaultValue: UUIDV4
      },
      org_id: { type: UUID, primaryKey: true, allowNull: false },
      user_id: { type: UUID, primaryKey: true, allowNull: false },
      create_user_id: { type: UUID, allowNull: true },
      modify_user_id: { type: UUID, allowNull: true },
      create_time: { type: DATE, allowNull: false },
      modify_time: { type: DATE, allowNull: false }
    });
  },
  down: async queryInterface => {
    await queryInterface.dropTable("t_org_user");
  }
};
